package com.ncu.week2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button = (Button)findViewById(R.id.button);
        final EditText name=(EditText)findViewById(R.id.editText3);
        final EditText password=(EditText)findViewById(R.id.editText);
        button.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                String input_name=name.getText().toString();
                String input_password=password.getText().toString();
                Intent intent = new Intent(MainActivity.this,Main3Activity.class)  ;
                intent.putExtra("name",input_name);
                intent.putExtra("password",input_password);
                startActivity(intent);
            }
        });
    }

}
